<?php
namespace app\home\controller;

use think\Request;

class BaseController extends \think\Controller
{

    private $uid;
    private $siteId;
    public $webconfig;

    /**
     * 初始化
     */
    public function __construct(Request $request = null)
    {
        parent::__construct($request);
        $this->webconfig = cache('webconfig');
        $this->uid=0;
        $this->siteId=0;
        $des = is_login('member');
        if ($des !== false) {
            $this->uid = $des['uid'];
            $this->siteId = $des['site_id'];
        }
        $this->view = $this->view->config('view_path', './tpl/');
        $this->assign('keyword', $this->webconfig['KEYWORDS']);
        $this->assign('description', $this->webconfig['DESCRIPTION']);
        $this->assign('location',goods_location($this->request->param('cid')));
    }

    /*
     * 获取会员Uid
     */
    public function getMemberUid()
    {
        return $this->uid;
    }

    /**
     * 获取会员对应站点ID
     * @return mixed
     */
    public function getSiteId(){
        return $this->siteId;
    }

}